package at.fhooe.mcm12.swa.ex3;

import java.util.Vector;

import at.fhooe.mcm12.swa.ex3.db.DBAbstractionLayer;
import at.fhooe.mcm12.swa.ex3.db.DummyDBConnection;
import at.fhooe.mcm12.swa.ex3.model.Runner;

/**
 * The Class Main.
 */
public class Main {

	/**
	 * The main method.
	 *
	 * @param args the arguments
	 */
	public static void main(String[] args) {
		// initialize dbal with dummy db connection
		DBAbstractionLayer dbal = new DBAbstractionLayer(new DummyDBConnection());
		
		// retrieve all runners
		Vector<Runner> runners = dbal.getAllRunners();
		System.out.println("RUNNERS:");
		for(Runner run : runners) {
			System.out.println("ID: " + run.getId() + " Name: " + run.getName());
		}
		
		// get mean time the runners need for one story
		System.out.println("Mean time per story: " + dbal.getMeanStoryTime() + "ms");
		
		// get the number of runners
		System.out.println("Runners : " + dbal.getNumberRunners());
		
		// get the number of runners already started
		System.out.println("Runners started: " + dbal.getNumberStarted());
		
		// get the number of runners finished
		System.out.println("Runners finished: " + dbal.getNumberFinished());
	}

}
